bpo-33897: Add a 'force' keyword argument to logging.basicConfig().#7873
bpo-33897: Add a 'force' keyword argument to logging.basicConfig().#7873vsajip merged 1 commit intopython:masterfrom
Conversation
fad9c50 to
a55dfa1
Compare
There was a problem hiding this comment.
... has handlers configured, unless the keyword argument force is set to True.
There was a problem hiding this comment.
... is specified as true, any existing handlers attached to the root logger are removed and closed, before carrying out the configuration as specified by the other arguments.
There was a problem hiding this comment.
... has handlers configured, unless the keyword argument force is set to True.
There was a problem hiding this comment.
... is specified as true, any existing handlers attached to the root logger are removed and closed, before carrying out the configuration as specified by the other arguments.
There was a problem hiding this comment.
Is this seek() call needed? Doesn't getvalue() get the entire output, anyway?
There was a problem hiding this comment.
Added a 'force' keyword argument to logging.basicConfig().
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
There was a problem hiding this comment.
Suggestion: Can we log on debug on this line? This way is very clear that the INFO:root:info comes after calling logging.basicConfig(level=logging.INFO, stream=sys.stdout, force=True) and not before.
There was a problem hiding this comment.
Good point. Perhaps better yet, we could assert that output.getvalue() contains only the WARNING line after this call, or immediately before the logging.info() call which follows this one.
e6891de to
5e40306
Compare
|
@vsajip @pablogsal |
There was a problem hiding this comment.
Please use WARNING here, WARN is only around for backward compatibility.
|
@vsajip Thanks updated! |
https://bugs.python.org/issue33897